import {immer} from "zustand/middleware/immer";
import {devtools, persist, PersistOptions} from "zustand/middleware";
import {StateCreator} from "zustand";

const middlewares = <S>(f: StateCreator<S, [["zustand/immer", never], ["zustand/devtools", never],["zustand/immer", never]], [["zustand/persist", S]], S>, options: PersistOptions<S>) => immer(devtools(persist(f, options)))

export default middlewares;
